]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Fix off-by-one error
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 8 Jan 2021 01:14:42 +0000 (02:14 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 26 Jan 2021 21:07:15 +0000 (22:07 +0100)
The scroll adjustment's upper value corresponds to the number of
workspaces, not to the last workspace index. We want the latter
when mirroring the layout in RTL locales, so subtract 1.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1598>

js/ui/workspacesView.js

index 865b52b502b80f96f495652e9b45de99c97b5830..12f5ca3a81ed7074224708ad1b09c242c0672dfe 100644 (file)
@@ -300,7 +300,7 @@ class WorkspacesView extends WorkspacesViewBase {
         const vertical = workspaceManager.layout_rows === -1;
         const rtl = this.text_direction === Clutter.TextDirection.RTL;
         const progress = vertical || !rtl
-            ? adj.value : adj.upper - adj.value;
+            ? adj.value : adj.upper - adj.value - 1;
 
         for (const ws of this._workspaces) {
             if (vertical)